
import random
import requests
import json
import hashlib
# urls = [f'https://httpbin.org/get?value={random.randint(1,10)}'for i in range(1,10)]
# list = set()
# for url in urls:
#     if url not in list:
#         list.add(url)
#         res = requests.get(url)
#         print(res.json())
#     else:
#         print('已经请求过了')


url = f'https://httpbin.org/post'
datas = [{"id":1,'value':random.randint(1,10)}for i in range(1,10)]

requests_data = set()
for data in datas:
    hash = hashlib.md5(json.dumps(data).encode('utf-8')).hexdigest()
    if hash not in requests_data:
        requests_data.add(hash)
        response = requests.post(url,data=data)
        print(response.json())
    else:
        print("该网址已经请求过了")



















